# coding:utf-8
# Author: legend
# @Time： 2020/8/27 下午10:05
from gettext import gettext as _

from base.constant import *

YES_OR_NO = (
    (YesOrNo.NO, _('no')),
    (YesOrNo.YES, _('yes'))
)

STAT_FIELDS_MERGE_STRATEGY = (
    (StatFieldMergeStrategy.NULL, _('can`t merge')),
    (StatFieldMergeStrategy.SUM, _('sum')),
    (StatFieldMergeStrategy.AVERAGE, _('average'))
)

SERVICE_STATUS = (
    (ServiceStatus.STOPPED, _('stopped')),
    (ServiceStatus.RUNNING, _('running'))
)

DEVICE_STATUS = (
    (DeviceStatus.OFFLINE, _('offline')),
    (DeviceStatus.ONLINE, _('online')),
)

PROVIDER = (
    (Provider.CHINA_MOBILE, _('china mobile')),
    (Provider.CHINA_TELECOM, _('china telecom')),
    (Provider.CHINA_UNINCOM, _('china unincom'))
)

STAT_FIELDS_DATA_TYPE = (
    (DataType.INT, _('int')),
    (DataType.BIGINT, _('bigint')),
    (DataType.FLOAT, _('float')),
    (DataType.STR, _('str'))
)

ALARM_LEVEL = (
    (AlarmLevel.FATAL, _('fatal')),
    (AlarmLevel.SERIOUS, _('serious')),
    (AlarmLevel.WARNING, _('warning'))
)

ALARM_STATUS = (
    (AlarmStatus.CREATED, _('not cleared')),
    (AlarmStatus.AUTO_CLEAR, _('auto cleared')),
    (AlarmStatus.MANUAL_CLEAR, _('manual cleared'))
)

CONDITION = (
    (AlarmConfigCondition.EQUAL, _('equal')),
    (AlarmConfigCondition.UNEQUAL, _('unequal')),
    (AlarmConfigCondition.GTE, _('gte')),
    (AlarmConfigCondition.LTE, _('lte')),
    (AlarmConfigCondition.CONTAIN, _('contain')),
    (AlarmConfigCondition.NOT_CONTAIN, _('not contain')),
)

SNMP_TYPE = (
    (AlarmConfigSnmpType.NOT_SEND, _('not send snmp alarm')),
    (AlarmConfigSnmpType.SEND, _('send snmp alarm'))
)

PROCESS_STATUS = (
    (ProcessStatus.RUNNING, 'running'),
    (ProcessStatus.SLEEPING, 'sleeping'),
    (ProcessStatus.DISK_SLEEP, 'disk-sleep'),
    (ProcessStatus.STOPPED, 'stopped'),
    (ProcessStatus.TRACING_STOP, 'tracing-stop'),
    (ProcessStatus.ZOMBIE, 'zombie'),
    (ProcessStatus.DEAD, 'dead'),
    (ProcessStatus.WAKE_KILL, 'wake-kill'),
    (ProcessStatus.WAKING, 'waking'),
    (ProcessStatus.IDLE, 'idle'),
    (ProcessStatus.PARKED, 'parked'),
)

DEPLOYMENT_TYPE = (
    (AppDeploymentType.MASTER_OR_STANDBY, _('master or standby')),
    (AppDeploymentType.BALANCE, _('load balancing')),
    (AppDeploymentType.INDEPENDENCE, _('independence'))
)

FILE_TYPE = (
    (FileType.YAML, _('yaml file')),
    (FileType.CNF, _('cnf file')),
    (FileType.CONF, _('conf file')),
    (FileType.INI, _('ini file')),
    (FileType.INTF, _('intf file')),
)

FORM_TYPE = (
    (FormType.INPUT, _('input label')),
    (FormType.SELECT, _('select label')),
    (FormType.RADIO, _('radio lable')),
    (FormType.CHECKBOX, _('checkbox lable')),
    (FormType.LIST, _('list lable')),
)

CHANGE_TYPE = (
    (FormType.INPUT, _('input label')),
    (FormType.SELECT, _('select label')),
    (FormType.RADIO, _('radio lable')),
    (FormType.CHECKBOX, _('checkbox lable')),
)

FORM_DATA_TYPE = (
    (FormDataType.INT, _('int')),
    (FormDataType.BIGINT, _('bigint')),
    (FormDataType.FLOAT, _('float')),
    (FormDataType.STR, _('str'))
)

PIPE_TYPE = (
    (0, _('status pipe')),
    (1, _('date pipe')),  # 时间戳格式化成日期
    (2, _('byte pipe')),
    (3, _('unit pipe')),
    (4, _('speed pipe')),
    (5, _('time pipe')),  # 时间单位转化
)

SERVICE_EXCEPTION_HANDLING = (
    (0, _('local handle')),
    (1, _('different place data guard'))
)

STATUS = (
    (0, _('stopped')),
    (1, _('running'))
)

PRIORITY_IP_TYPE = (
    (0, _('IPV4')),
    (1, _('IPV6'))
)

DEVICE_TYPE = (
    (0, _('COLLECT')),
    (1, _('MERGE')),
    (2, _('FILE')),
    (100, _('OTHER')),
)

METHOD = (
    (RequestMethod.GET, _('get')),
    (RequestMethod.POST, _('post')),
    (RequestMethod.DELETE, _('delete')),
    (RequestMethod.PUT, _('put')),
    (RequestMethod.PATCH, _('patch'))
)

PROTOCOL = (
    (0, _('http | https')),
    (1, _('ws | wss'))
)

PERMISSION_TYPES = (
    (PermissionGroupType.NORMAL, _('normal group')),
    (PermissionGroupType.SUPER, _('super group')),
)
